package com.ryandj.exMessage;


/**
 * 登录错误 1xxxx
 */
public enum LoginErrMsg {

    SUCCESS(200,"success"),
    INTERNAL_ERROR(10000,"内部错误"),
    USER_NOT_FOUND(10001,"用户名有误"),
    INVALID_PASSWORD(10002,"密码错误"),
    USER_NAME_EMPTY(10003,"用户名不可为空"),
    USER_PASSWORD_EMPTY(10004,"密码不可为空"),
    ;

    private final int code;
    private final String message;

    LoginErrMsg(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public String formatMessage(Object... args){
        return String.format(message,args);
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}